home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 October: Mac OS SDK / Dev.CD Oct 00 SDK1.toast / Development Kits / Mac OS / Apple Guide / Engineering / AGSample / guide source / AGSampleGuide.ag < prev    next >
Encoding:
Text File  |  1996-04-15  |  28.8 KB  |  872 lines  |  [TEXT/MPS ]

  1. # AGSampleGuide.ag
  2. # Copyright 1996, Apple Computer, Inc.
  3. # Date:        21-Mar-96
  4. # Author:    guideWorks, LLC
  5. # Web:        http://www.guideworks.com/
  6. # EMail:    powers@guideworks.com
  7. #
  8. # About this guide file
  9. #
  10. # This file contains all the Guide Script for the guide file
  11. # that goes with AGSample. To keep things simple as possible,
  12. # this guide file includes only unstyled text
  13. # and as few Guide Script commands as possible.
  14. # No XTND translators are required for compiling this guide file.
  15. #
  16. # AGSample demonstrates the following Apple Guide integration features:
  17. #
  18. # Object Coach
  19. # Context Check
  20. # AppleScript Coach
  21. # Opening a guide file to its default state
  22. # Opening a guide file with search
  23. # Use of AGFile library
  24.  
  25. # --- Setup -------------------------------------------------------------
  26.  
  27. # Basic setup for window type, menu, and version.
  28. <Startup Window> FULL, HOWDY
  29. <App Text> "AGSample Guide"
  30. <Help Menu> "AGSample Guide", HELP
  31. <Version> "v1.0.1 ©1996 Apple Computer, Inc. All rights reserved.","1.0.1","v1.0.1"
  32.  
  33. # Define AppleScript coaches and their AppleScript scripts.
  34. # The scripts are included in the same folder as this Guide Script file.
  35. # Guide Maker extracts 'scpt' resources from the AppleScript script files
  36. # and puts them into the guide file.
  37. <Define AppleScript Coach> "ASCoach open guide button", REDCIRCLE, "AGSampleASCoach1001"
  38. <Define AppleScript Coach> "ASCoach checkbox", REDCIRCLE, "AGSampleASCoach2001"
  39.  
  40. # Define object coaches for use with AGSample.
  41. <Define Object Coach> "Coach open guide button", 'AGS2', REDCIRCLE, "1001"
  42. <Define Object Coach> "Coach open guide with search button", 'AGS2', REDCIRCLE, "1002"
  43. <Define Object Coach> "Coach checkbox", 'AGS2', REDCIRCLE, "2001"
  44.  
  45. # Define context checks for use with AGSample.
  46. # Referencing these context checks in the Guide Script
  47. # will cause a warning in the Guide Maker compilation
  48. # because Guide Maker is expecting external modules.
  49. # Since we are using context checks in the application
  50. # instead of external modules, we ignore the warnings.
  51. <Define Context Check> "IsAnyDocumentOpen", 'agsd', 'AGS2', LONG:1, LONG:0
  52. <Define Context Check> "IsThisControlFront", 'agsd', 'AGS2', LONG:2, LONG
  53. <Define Context Check> "IsThisControlTrue", 'agsd', 'AGS2', LONG:3, LONG
  54.  
  55. # Define Apple events for use with AGSample.
  56. <Define Event> "OpenNewDocument", 'AGS2', 'agse', 'agsw'
  57. <Define Event> "CloseDocument", 'AGS2', 'agse', 'agsx'
  58.  
  59. # Include search phrases in a STR# resource for access by the application.
  60. # The search phrases are stored in the guide file to aid maintenance.
  61. # They are accesed by AGSample and sent to Apple Guide in AGOpenWithSearch.
  62. <Resource> "AGSSearchPhrases.rsrc", ALL
  63.  
  64. # Include PICTs needed by the guide.
  65. <Resource> "AGSamplePICT.rsrc", ALL
  66.  
  67. # We add an event and button to return the user to the access window.
  68. <Define Event>    "GoStart", 's***', 'help', 'stac'
  69. <Define Nav Button> "GoStart",1111,1113,1115, GoStart()
  70. <Define Nav Button Set> "GoStart Only","GoStart"
  71. <Default Nav Button Set> "GoStart Only"
  72.  
  73. # We will use the standard Tag and Body formats occasionally.
  74. # When we don't specify a format in the panel, Apple Guide uses the full width.
  75. <Define Format>    "Tag", Column(6,0,54), "Espy Sans Bold", 10, PLAIN, ,Right, false
  76. <Define Format>    "Body", Column(6,65,330), "Espy Serif", 10, PLAIN, ,Left, true
  77.  
  78. # --- Access Window - Howdy ----------------------------------------------
  79.  
  80. # Define the text for the initial, "Howdy" view.
  81. <Howdy> "AGSample Howdy"
  82. <Define Text Block> "AGSample Howdy"
  83. Welcome to the AGSample guide.
  84.  
  85. This guide describes and demonstrates Apple Guide integration in an application.
  86.  
  87. To start, click Topics, Index, or Look For.
  88. <End Text Block>
  89.  
  90. # --- Access Window - Topic Areas ----------------------------------------
  91.  
  92. <Topic Area> "Demonstrations"
  93.     <Header> "About"
  94.         <Topic> "this guide", "About guide"
  95.         <Topic> "AGSample", "About AGSample"
  96.     <Header> "Integration Feature"
  97.         <Topic> "Apple events", "Apple events"
  98.         <Topic> "AppleScript Coach", "AppleScript Coach"
  99.         <Topic> "Context Check", "Context Check"
  100.         <Topic> "Object Coach", "Object Coach"
  101.         <Topic> "Open guide", "Open guide"
  102.         <Topic> "Open guide with search", "Open with search"
  103. <Topic Area> "Usage"
  104.     <Header> "About"
  105.         <Topic> "this guide", "About guide"
  106.         <Topic> "AGSample", "About AGSample"
  107.     <Header> "AGSample Components"
  108.         <Topic> "Application", "AGSample Components - Application"
  109.         <Topic> "Guide", "AGSample Components - Guide"
  110.         <Topic> "Source", "AGSample Components - Source"
  111.         <Topic> "Resources", "AGSample Components - Resources"
  112.         <Topic> "Libraries", "AGSample Components - Libraries"
  113.     <Header> "How do I"
  114.         <Topic> "build the Guide", "HDI build Guide"
  115.         <Topic> "integrate the sample", "HDI integrate sample"
  116.  
  117. # --- Access Window - Index ----------------------------------------------
  118.  
  119. <Index> "about"
  120.     <Header> "What is"
  121.         <Topic> "this guide?", "About guide"
  122.         <Topic> "AGSample?", "About AGSample"
  123. <Index> "aete"
  124.     <Header> "What is"
  125.         <Topic> "aete", "AGSample Components - Resources"
  126. <Index> "AGFileLib"
  127.     <Header> "Integration Feature"
  128.         <Topic> "Open guide with search", "Open with search"
  129.     <Header> "What is"
  130.         <Topic> "AGFileLib", "AGSample Components - Libraries"
  131. <Index> "AGFileLib.xcoff"
  132.     <Header> "Integration Feature"
  133.         <Topic> "Open guide with search", "Open with search"
  134.     <Header> "What is"
  135.         <Topic> "AGFileLib", "AGSample Components - Libraries"
  136. <Index> "AGFileGetIndDB"
  137.     <Header> "Integration Feature"
  138.         <Topic> "Open guide with search", "Open with search"
  139. <Index> "AGSSearchPhrases"
  140.     <Header> "What is"
  141.         <Topic> "AGSSearchPhrases.rsrc", "HDI build Guide"
  142. <Index> "AGSSearchPhrases.rsrc"
  143.     <Header> "What is"
  144.         <Topic> "AGSSearchPhrases.rsrc", "HDI build Guide"
  145. <Index> "AGInstallCoachHandler"
  146.     <Header> "Integration Feature"
  147.         <Topic> "Object Coach", "Object Coach"
  148. <Index> "AGInstallContextHandler"
  149.     <Header> "Integration Feature"
  150.         <Topic> "Context Check", "Context Check"
  151. <Index> "AGOpen"
  152.     <Header> "Integration Feature"
  153.         <Topic> "Open guide", "Open guide"
  154. <Index> "AGOpenWithSearch"
  155.     <Header> "Integration Feature"
  156.         <Topic> "Open guide with search", "Open with search"
  157. <Index> "AGRemoveCoachHandler"
  158.     <Header> "Integration Feature"
  159.         <Topic> "Object Coach", "Object Coach"
  160. <Index> "AGRemoveContextHandler"
  161.     <Header> "Integration Feature"
  162.         <Topic> "Context Check", "Context Check"
  163. <Index> "AGSample"
  164.     <Header> "What is"
  165.         <Topic> "AGSample", "AGSample Components - Application"
  166. <Index> "AGSample.68K"
  167.     <Header> "What is"
  168.         <Topic> "AGSample", "AGSample Components - Application"
  169. <Index> "AGSample.PPC"
  170.     <Header> "What is"
  171.         <Topic> "AGSample", "AGSample Components - Application"
  172. <Index> "AGSampleCode"
  173.     <Header> "What is"
  174.         <Topic> "AGSampleCode.c", "AGSample Components - Source"
  175.         <Topic> "AGSampleCode.h", "AGSample Components - Source"
  176. <Index> "AGSampleCode.c"
  177.     <Header> "What is"
  178.         <Topic> "AGSampleCode.c", "AGSample Components - Source"
  179. <Index> "AGSampleCode.h"
  180.     <Header> "What is"
  181.         <Topic> "AGSampleCode.h", "AGSample Components - Source"
  182. <Index> "AGSampleASCoach1001"
  183.     <Header> "What is"
  184.         <Topic> "AGSampleASCoach1001", "HDI build Guide"
  185. <Index> "AGSampleASCoach2001"
  186.     <Header> "What is"
  187.         <Topic> "AGSampleASCoach2001", "HDI build Guide"
  188. <Index> "AGSampleASCoach"
  189.     <Header> "What is"
  190.         <Topic> "AGSampleASCoach.r", "AGSample Components - Resources"
  191.         <Topic> "AGSampleASCoach.rsrc", "AGSample Components - Resources"
  192.         <Topic> "AGSampleASCoach.rsrc.make", "AGSample Components - Resources"
  193. <Index> "AGSampleASCoach.r"
  194.     <Header> "What is"
  195.         <Topic> "AGSampleASCoach.r", "AGSample Components - Resources"
  196. <Index> "AGSampleASCoach.rsrc"
  197.     <Header> "What is"
  198.         <Topic> "AGSampleASCoach.rsrc", "AGSample Components - Resources"
  199. <Index> "AGSampleASCoach.rsrc.make"
  200.     <Header> "What is"
  201.         <Topic> "AGSampleASCoach.rsrc.make", "AGSample Components - Resources"
  202. <Index> "AGSampleGuide"
  203.     <Header> "What is"
  204.         <Topic> "AGSampleGuide.ag", "HDI build Guide"
  205.         <Topic> "AGSample Guide", "AGSample Components - Guide"
  206. <Index> "AGSampleGuide.ag"
  207.     <Header> "What is"
  208.         <Topic> "AGSampleGuide.ag", "HDI build Guide"
  209. <Index> "AGSample Guide"
  210.     <Header> "What is"
  211.         <Topic> "AGSample Guide", "AGSample Components - Guide"
  212. <Index> "AGSamplePICT"
  213.     <Header> "What is"
  214.         <Topic> "AGSamplePICT.rsrc", "HDI build Guide"
  215. <Index> "AGSamplePICT.rsrc"
  216.     <Header> "What is"
  217.         <Topic> "AGSamplePICT.rsrc", "HDI build Guide"
  218. <Index> "AGSCoachItemAccessor"
  219.     <Header> "Integration Feature"
  220.         <Topic> "AppleScript Coach", "AppleScript Coach"
  221. <Index> "AGSCoachItemPropertyAccessor"
  222.     <Header> "Integration Feature"
  223.         <Topic> "AppleScript Coach", "AppleScript Coach"
  224. <Index> "AGSCoachReplyProc"
  225.     <Header> "Integration Feature"
  226.         <Topic> "Object Coach", "Object Coach"
  227. <Index> "AGSContextReplyProc"
  228.     <Header> "Integration Feature"
  229.         <Topic> "Context Check", "Context Check"
  230. <Index> "AGSGetDataItemCoachRect"
  231.     <Header> "Integration Feature"
  232.         <Topic> "AppleScript Coach", "AppleScript Coach"
  233. <Index> "AGSHandleGetData"
  234.     <Header> "Integration Feature"
  235.         <Topic> "AppleScript Coach", "AppleScript Coach"
  236. <Index> "AGSHandleAEvents"
  237.     <Header> "Integration Feature"
  238.         <Topic> "Apple events", "Apple events"
  239. <Index> "AGSInstallASCoachHandlers"
  240.     <Header> "Integration Feature"
  241.         <Topic> "AppleScript Coach", "AppleScript Coach"
  242. <Index> "AGSInstallAEHandler"
  243.     <Header> "Integration Feature"
  244.         <Topic> "Apple events", "Apple events"
  245. <Index> "AGSInstallCoachHandler"
  246.     <Header> "Integration Feature"
  247.         <Topic> "Object Coach", "Object Coach"
  248. <Index> "AGSInstallContextHandler"
  249.     <Header> "Integration Feature"
  250.         <Topic> "Context Check", "Context Check"
  251. <Index> "AGSOpenGuide"
  252.     <Header> "Integration Feature"
  253.         <Topic> "Open guide", "Open guide"
  254. <Index> "AGSOpenGuideWithSearch"
  255.     <Header> "Integration Feature"
  256.         <Topic> "Open with search", "Open with search"
  257. <Index> "AGSRemoveAEHandler"
  258.     <Header> "Integration Feature"
  259.         <Topic> "Apple events", "Apple events"
  260. <Index> "AGSRemoveASCoachHandlers"
  261.     <Header> "Integration Feature"
  262.         <Topic> "AppleScript Coach", "AppleScript Coach"
  263. <Index> "AGSRemoveCoachHandler"
  264.     <Header> "Integration Feature"
  265.         <Topic> "Object Coach", "Object Coach"
  266. <Index> "AGSRemoveContextHandler"
  267.     <Header> "Integration Feature"
  268.         <Topic> "Context Check", "Context Check"
  269. <Index> "Apple events"
  270.     <Header> "Integration Feature"
  271.         <Topic> "Apple events", "Apple events"
  272. <Index> "AppleGuideGlueLib"
  273.     <Header> "What is"
  274.         <Topic> "AppleGuideGlueLib", "AGSample Components - Libraries"
  275. <Index> "AppleGuideGlueLib.xcoff"
  276.     <Header> "What is"
  277.         <Topic> "AppleGuideGlueLib.xcoff", "AGSample Components - Libraries"
  278. <Index> "AppleScript"
  279.     <Header> "Integration Feature"
  280.         <Topic> "AppleScript Coach", "AppleScript Coach"
  281.     <Header> "What is"
  282.         <Topic> "AppleScript Terminology", "AGSample Components - Resources"
  283. <Index> "AppleScript Coach"
  284.     <Header> "Integration Feature"
  285.         <Topic> "AppleScript Coach", "AppleScript Coach"
  286. <Index> "Application"
  287.     <Header> "What is"
  288.         <Topic> "Application", "AGSample Components - Application"
  289. <Index> "c"
  290.     <Header> "What is"
  291.         <Topic> "AGSampleCode.c", "AGSample Components - Source"
  292. <Index> "coach"
  293.     <Header> "Integration Feature"
  294.         <Topic> "Object Coach", "Object Coach"
  295.         <Topic> "AppleScript Coach", "AppleScript Coach"
  296. <Index> "context"
  297.     <Header> "Integration Feature"
  298.         <Topic> "Context Check", "Context Check"
  299. <Index> "demonstrations"
  300.     <Header> "Integration Feature"
  301.         <Topic> "Apple events", "Apple events"
  302.         <Topic> "AppleScript Coach", "AppleScript Coach"
  303.         <Topic> "Context Check", "Context Check"
  304.         <Topic> "Object Coach", "Object Coach"
  305.         <Topic> "Open guide", "Open guide"
  306.         <Topic> "Open guide with search", "Open with search"
  307. <Index> "events"
  308.     <Header> "Integration Feature"
  309.         <Topic> "Apple events", "Apple events"
  310. <Index> "h"
  311.     <Header> "What is"
  312.         <Topic> "AGSampleCode.h", "AGSample Components - Source"
  313. <Index> "make"
  314.     <Header> "What is"
  315.         <Topic> "AGSampleASCoach.rsrc.make", "AGSample Components - Resources"
  316. <Index> "Object Coach"
  317.     <Header> "Integration Feature"
  318.         <Topic> "Object Coach", "Object Coach"
  319. <Index> "open"
  320.     <Header> "Integration Feature"
  321.         <Topic> "Open guide", "Open guide"
  322.         <Topic> "Open guide with search", "Open with search"
  323. <Index> "open guide"
  324.     <Header> "Integration Feature"
  325.         <Topic> "Open guide", "Open guide"
  326.         <Topic> "Open guide with search", "Open with search"
  327. <Index> "PPC"
  328.     <Header> "What is"
  329.         <Topic> "AGSample.PPC", "AGSample Components - Application"
  330.         <Topic> "AGFileLib.xcoff", "AGSample Components - Libraries"
  331.         <Topic> "AppleGuideGlueLib.xcoff", "AGSample Components - Libraries"
  332.     <Header> "How do I"
  333.         <Topic> "integrate the sample", "HDI integrate sample"
  334. <Index> "resources"
  335.     <Header> "What is"
  336.         <Topic> "AGSSearchPhrases.rsrc", "HDI build Guide"
  337.         <Topic> "AGSampleASCoach.rsrc", "AGSample Components - Resources"
  338.         <Topic> "AGSampleASCoach.rsrc.make", "AGSample Components - Resources"
  339.         <Topic> "AGSamplePICT.rsrc", "HDI build Guide"
  340. <Index> "rsrc"
  341.     <Header> "What is"
  342.         <Topic> "AGSSearchPhrases.rsrc", "HDI build Guide"
  343.         <Topic> "AGSampleASCoach.rsrc", "AGSample Components - Resources"
  344.         <Topic> "AGSampleASCoach.rsrc.make", "AGSample Components - Resources"
  345.         <Topic> "AGSamplePICT.rsrc", "HDI build Guide"
  346. <Index> "68K"
  347.     <Header> "What is"
  348.         <Topic> "AGSample.68K", "AGSample Components - Application"
  349.     <Header> "How do I"
  350.         <Topic> "integrate the sample", "HDI integrate sample"
  351. <Index> "usage"
  352.     <Header> "AGSample Components"
  353.         <Topic> "Application", "AGSample Components - Application"
  354.         <Topic> "Guide", "AGSample Components - Guide"
  355.         <Topic> "Source", "AGSample Components - Source"
  356.         <Topic> "Resources", "AGSample Components - Resources"
  357.         <Topic> "Libraries", "AGSample Components - Libraries"
  358.     <Header> "How do I"
  359.         <Topic> "build the Guide", "HDI build Guide"
  360.         <Topic> "integrate the sample", "HDI integrate sample"
  361. <Index> "xcoff"
  362.     <Header> "What is"
  363.         <Topic> "AGFileLib.xcoff", "AGSample Components - Libraries"
  364.         <Topic> "AppleGuideGlueLib.xcoff", "AGSample Components - Libraries"
  365.  
  366. # --- Access Window - Look For ------------------------------------------
  367.  
  368. # The Look For treats a period as a delimiter.
  369. # For example AGSampleCode.c becomes AGSampleCode and c.
  370. # We handle that by entering both words as index terms.
  371.  
  372. # The Apple Guide stemmer removes "ion", "s", "er", and other suffixes.
  373. # We create synonyms to insure that Look-For works properly.
  374. <Synonym> "AGInstallCoachHandler", "AGInstallCoachHandl"
  375. <Synonym> "AGInstallContextHandler", "AGInstallContextHandl"
  376. <Synonym> "AGOpenWithSequence", "AGOpenWithSequ"
  377. <Synonym> "AGRemoveCoachHandler", "AGRemoveCoachHandl"
  378. <Synonym> "AGRemoveContextHandler", "AGRemoveContextHandl"
  379. <Synonym> "AGSHandleAEvents", "AGSHandleAEv"
  380. <Synonym> "application", "applic"
  381. <Synonym> "demonstrations", "demonstr"
  382. <Synonym> "events", "event"
  383. <Synonym> "integration", "integr"
  384. <Synonym> "68K", "k"
  385. <Synonym> "resources", "resource"
  386. # And we add some real synonyms too.
  387. <Synonym> "demonstrations", "demo"
  388.  
  389. # --- Sequences ---------------------------------------------------------
  390.  
  391. <Define Sequence> "About guide", "About this guide"
  392. <Panel> "About guide"
  393. <Panel> "About Credits"
  394. <End Sequence>
  395.  
  396. <Define Sequence> "About AGSample", "About AGSample"
  397. <Panel> "About AGSample 1"
  398. <Panel> "About AGSample 2"
  399. <Panel> "About Apps-To-Go"
  400. <Panel> "About Credits"
  401. <End Sequence>
  402.  
  403. <Define Sequence> "Object Coach",  "Object Coach"
  404. <Panel> "IntroObjectCoach"
  405. <Skip If> IsAnyDocumentOpen()
  406.     <Panel> "No documents are open"
  407. <Skip If> IsThisControlFront(1001)
  408.     <Panel> "Open guide button is not front"
  409. <Skip If> NOT IsThisControlFront(1001)
  410.     <Panel> "Coach open guide button"
  411. <Skip If> IsThisControlFront(2001)
  412.         <Panel> "Checkbox is not front"
  413. <Skip If> NOT IsThisControlFront(2001)
  414.         <Panel> "Coach checkbox"
  415. <End Sequence>
  416.  
  417. <Define Sequence> "AppleScript Coach",  "AppleScript Coach"
  418. <Panel> "IntroASCoach"
  419. <Skip If> IsAnyDocumentOpen()
  420.     <Panel> "No documents are open"
  421. <Skip If> IsThisControlFront(1001)
  422.     <Panel> "Open guide button is not front"
  423. <Skip If> NOT IsThisControlFront(1001)
  424.     <Panel> "ASCoach Open guide button"
  425. <Skip If> IsThisControlFront(2001)
  426.         <Panel> "Checkbox is not front"
  427. <Skip If> NOT IsThisControlFront(2001)
  428.         <Panel> "ASCoach checkbox"
  429. <End Sequence>
  430.  
  431. <Define Sequence> "Context Check",  "Context Check"
  432. <Panel> "IntroContextCheck"
  433. <Skip If> IsAnyDocumentOpen()
  434.     <Panel> "No documents are open"
  435. <Skip If> NOT IsAnyDocumentOpen()
  436.     <Panel> "A document is open"
  437. <Skip If> IsThisControlFront(2001)
  438.         <Panel> "Checkbox is not front"
  439. <Skip If> NOT IsThisControlFront(2001)
  440.         <Panel> "Checkbox is front"
  441. <Skip If> IsThisControlTrue(2001)
  442.         <Panel> "Checkbox is not checked"
  443. <Skip If> NOT IsThisControlTrue(2001)
  444.         <Panel> "Checkbox is checked"
  445. <End Sequence>
  446.  
  447. <Define Sequence> "Apple events",  "Apple events"
  448. <Panel> "IntroAppleEvents"
  449. <Skip If> IsAnyDocumentOpen()
  450.     <Panel> "Open a new document"
  451. <Skip If> NOT IsAnyDocumentOpen()
  452.     <Panel> "Close a document"
  453. <Skip If> IsAnyDocumentOpen()
  454.     <Panel> "Open a new document"
  455. <Skip If> NOT IsAnyDocumentOpen()
  456.     <Panel> "Close a document"
  457. <End Sequence>
  458.  
  459. <Define Sequence> "Open guide", "Open guide"
  460. <Panel> "IntroOpenGuide"
  461. <Skip If> IsAnyDocumentOpen()
  462.     <Panel> "No documents are open"
  463. <Skip If> IsThisControlFront(1001)
  464.     <Panel> "Open guide button is not front"
  465. <Skip If> NOT IsThisControlFront(1001)
  466.     <Panel> "Open guide button"
  467. <End Sequence>
  468.  
  469. <Define Sequence> "Open with search", "Open guide with search"
  470. <Panel> "IntroOpenWithSearch"
  471. <Skip If> IsAnyDocumentOpen()
  472.     <Panel> "No documents are open"
  473. <Skip If> IsThisControlFront(1001)
  474.     <Panel> "Open guide button is not front"
  475. <Skip If> NOT IsThisControlFront(1001)
  476.     <Panel> "Open guide with search button"
  477. <End Sequence>
  478.  
  479. <Define Sequence> "AGSample Components - Application", "Application"
  480. <Panel> "Component Application intro"
  481. <End Sequence>
  482.  
  483. <Define Sequence> "AGSample Components - Guide", "Guide"
  484. <Panel> "Component Guide intro"
  485. <Panel> "Component Guide AGSample"
  486. <Panel> "Component Guide Development"
  487. <End Sequence>
  488.  
  489. <Define Sequence> "AGSample Components - Source", "Source"
  490. <Panel> "Component Source"
  491. <End Sequence>
  492.  
  493. <Define Sequence> "AGSample Components - Resources", "Resources"
  494. <Panel> "Component Resources intro"
  495. <Panel> "Component Resources aete"
  496. <Panel> "aete"
  497. <End Sequence>
  498.  
  499. <Define Sequence> "AGSample Components - Libraries", "Libraries"
  500. <Panel> "Component Libraries intro"
  501. <Panel> "Component Libraries Glue"
  502. <Panel> "Component Libraries AGFile"
  503. <End Sequence>
  504.  
  505. <Define Sequence> "HDI build Guide", "How do I build the Guide"
  506. <Panel> "Build Guide intro"
  507. <Panel> "AGSampleGuide"
  508. <Panel> "AGSamplePICT"
  509. <Panel> "AGSSearchPhrases"
  510. <Panel> "AGSampleASCoach"
  511. <Panel> "Build Guide 1"
  512. <Panel> "Build Guide 2"
  513. <Panel> "Build Guide 3"
  514. <Panel> "Build Guide compile error"
  515. <Panel> "Component Guide intro"
  516. <End Sequence>
  517.  
  518. <Define Sequence> "HDI integrate sample", "How do I integrate the sample"
  519. <Panel> "Integrate sample intro"
  520. <Panel> "Integrate sample functions"
  521. <Panel> "AppleGuideGlueLib"
  522. <Panel> "AGFile"
  523. <Panel> "Add aete"
  524. <Panel> "You are done"
  525. <End Sequence>
  526.  
  527. # --- Panels -------------------------------------------------------------
  528.  
  529. <Define Panel> "About credits"
  530. AGSample and its guide were developed for Apple Developer Technical Support by:
  531.  
  532.    guideWorks, LLC
  533.    690 Saratoga Ave, Suite 205
  534.    San Jose CA 95129
  535.    408-556-1135
  536.    web - http://www.guideworks.com/
  537.    email - powers@guideworks.com
  538. <End Panel>
  539.  
  540. <Define Panel> "About guide"
  541. The AGSample guide describes Apple Guide integration.
  542.  
  543. When used with AGSample, the guide also demonstrates the following integration features:
  544.  
  545.      Object Coach
  546.      Context Check
  547.      AppleScript Coach
  548.      Opening a guide file to its default state
  549.      Opening a guide file with search
  550.      Use of AGFile library
  551. <End Panel>
  552.  
  553. <Define Panel> "About AGSample 1"
  554. AGSample is an example of basic Apple Guide integration in an application.
  555. <End Panel>
  556.  
  557. <Define Panel> "About AGSample 2"
  558. When used with the AGSample Guide, AGSample demonstrates the following integration features:
  559.  
  560.      Object Coach
  561.      Context Check
  562.      AppleScript Coach
  563.      Opening a guide file to its default state
  564.      Opening a guide file with search
  565.      Use of AGFile library
  566. <End Panel>
  567.  
  568. <Define Panel> "About Apps-To-Go"
  569. The AGSample application was built using AGSampleCode.c, AGSampleCode.h, and version 7.2 of Apps-To-Go.
  570.  
  571. Apps-To-Go is a collection of tools and libraries that support application prototyping and code development. Apps-To-Go was developed by Apple Developer Technical Support.
  572. <End Panel>
  573.  
  574. <Define Panel> "IntroObjectCoach"
  575. This sequence demonstrates the use of Object Coach to mark interface objects.
  576.  
  577. It uses the Object Coach to mark:
  578.      the Open guide button and
  579.      the checkbox.
  580.  
  581. The AGSample application should be open and front for this demonstration.
  582. <End Panel>
  583.  
  584. <Define Panel> "IntroASCoach"
  585. This sequence demonstrates the use of AppleScript Coach to mark interface objects.
  586.  
  587. It uses the AppleScript Coach to mark:
  588.      the Open guide button and
  589.      the checkbox.
  590.  
  591. The AGSample application should be open and front for this demonstration.
  592. <End Panel>
  593.  
  594. <Define Panel> "IntroContextCheck"
  595. This sequence demonstrates the use of Context Checks to test the state of the application.
  596.  
  597. It checks for:
  598.      a front document,
  599.      a front checkbox, and
  600.      the state of the checkbox.
  601.  
  602. The AGSample application should be open for this demonstration.
  603. <End Panel>
  604.  
  605. <Define Panel> "IntroAppleEvents"
  606. This sequence demonstrates sending Apple events from the guide to the application.
  607.  
  608. The AGSample application must be open and front for this demonstration.
  609. <End Panel>
  610.  
  611. <Define Panel> "Open a new document"
  612. Click the button to open a new document.
  613.  
  614. <Standard Button> "Open a New Document", CENTER, OpenNewDocument()
  615. <End Panel>
  616.  
  617. <Define Panel> "Close a document"
  618. Click the button to close the front document.
  619.  
  620. <Standard Button> "Close Front Document", CENTER, CloseDocument()
  621. <End Panel>
  622.  
  623. <Define Panel> "Coach open guide button"
  624. Coach the Open guide button.
  625. <Coach Mark> "Coach open guide button"
  626. <End Panel>
  627.  
  628. <Define Panel> "Coach checkbox"
  629. Coach the checkbox.
  630. <Coach Mark> "Coach checkbox"
  631. <End Panel>
  632.  
  633. <Define Panel> "ASCoach Open guide button"
  634. Coach the Open guide button.
  635. <Coach Mark> "ASCoach open guide button"
  636. <End Panel>
  637.  
  638. <Define Panel> "ASCoach checkbox"
  639. Coach the checkbox.
  640. <Coach Mark> "ASCoach checkbox"
  641. <End Panel>
  642.  
  643. <Define Panel> "Open guide button is not front"
  644. Open guide button is not front.
  645. <End Panel>
  646.  
  647. <Define Panel> "A document is open"
  648. A document is open.
  649. <End Panel>
  650.  
  651. <Define Panel> "No documents are open"
  652. No documents are open.
  653. <End Panel>
  654.  
  655. <Define Panel> "Checkbox is not front"
  656. Checkbox is not front.
  657. <End Panel>
  658.  
  659. <Define Panel> "Checkbox is front"
  660. Checkbox is front.
  661. <End Panel>
  662.  
  663. <Define Panel> "Checkbox is not checked"
  664. Checkbox is not checked.
  665. <End Panel>
  666.  
  667. <Define Panel> "Checkbox is checked"
  668. Checkbox is checked.
  669. <End Panel>
  670.  
  671. <Define Panel> "IntroOpenGuide"
  672. This sequence demonstrates the use of AGOpen to open a guide file in its default state.
  673.  
  674. It also uses the Object Coach to mark the button.
  675.  
  676. The AGSample application should be open and front for this demonstration.
  677. <End Panel>
  678.  
  679. <Define Panel> "Open guide button"
  680. Click the Open guide button to invoke the AGOpen toolbox call.
  681. <Coach Mark> "Coach open guide button"
  682. <End Panel>
  683.  
  684. <Define Panel> "IntroOpenWithSearch"
  685. This sequence demonstrates the use of AGOpenWithSearch to open a guide file with a keyword search.
  686.  
  687. It also uses the Object Coach to mark the button.
  688.  
  689. The AGSample application should be open and front for this demonstration.
  690. <End Panel>
  691.  
  692. <Define Panel> "Open guide with search button"
  693. Click the Open guide with search button to invoke the AGOpenWithSearch toolbox call.
  694.  
  695. The sample code passes a search string to AGOpenWithSearch. Apple Guide opens the guide file in the Look-For view, sets the search phrase to the passed string, and performs a search.
  696. <Coach Mark> "Coach open guide with search button"
  697. <End Panel>
  698.  
  699. <Define Panel> "Component AGFile"
  700. AGFile contains Apple Guide file-access functions. If you use an AGFile function, include the AGFile library.
  701. <End Panel>
  702.  
  703. <Define Panel> "Component Application intro"
  704. The sample applications are AGSample.68K and AGSample.PPC. They were built using Apps-To-Go v7.2.
  705.  
  706. The Apple Guide integration portion of AGSample is extracted as AGSampleCode.c and AGSampleCode.h. There are no sample code differences between the 68K and PPC applications.
  707. <End Panel>
  708.  
  709. <Define Panel> "Component Guide intro"
  710. When used with AGSample, the guide demonstrates Apple Guide integration.
  711.  
  712. The guide also provides helpful integration information.
  713. <End Panel>
  714.  
  715. <Define Panel> "Component Guide AGSample"
  716. To demonstrate Apple Guide integration features, place the AGSample Guide in the same folder as the AGSample application.
  717. <End Panel>
  718.  
  719. <Define Panel> "Component Guide Development"
  720. To assist you in Apple Guide integration, place the AGSample Guide in the same folder as your development application (EG MPW Shell, CodeWarrior IDE, or Symantec Project Manager).
  721. <End Panel>
  722.  
  723. <Define Panel> "Component Source"
  724. The AGSample source consists of two files:
  725.    • AGSampleCode.c
  726.    • AGSampleCode.h
  727. These files contain all the sample Apple Guide integration code.
  728. <End Panel>
  729.  
  730. <Define Panel> "Component Resources intro"
  731. The AGSample resource files are:
  732.    • AGSampleASCoach.r
  733.    • AGSampleASCoach.rsrc
  734.    • AGSampleASCoach.rsrc.make
  735. <End Panel>
  736.  
  737. <Define Panel> "Component Resources aete"
  738. AGSampleASCoach.rsrc contains the 'aete' resource for the sample AppleScript Coach.
  739.  
  740. AGSampleASCoach.r and AGSampleASCoach.rsrc.make were used to create AGSampleASCoach.rsrc.
  741. <End Panel>
  742.  
  743. <Define Panel> "Component Libraries intro"
  744. The AGSample library files are:
  745.    • AppleGuideGlueLib.xcoff
  746.    • AGFileLib
  747.    • AGFileLib.xcoff
  748. <End Panel>
  749.  
  750. <Define Panel> "Component Libraries Glue"
  751. AppleGuideGlueLib.xcoff is required for PPC applications that access Apple Guide toolbox functions.
  752.  
  753. An Apple Guide library is not required for 68K applications.
  754. <End Panel>
  755.  
  756. <Define Panel> "Component Libraries AGFile"
  757. AGFileLib.xcoff is the PPC library for AGFile.
  758. AGFileLib is the 68K library for AGFile.
  759.  
  760. AGFile contains Apple Guide file-access functions. If you use an AGFile function, include the AGFile library.
  761. <End Panel>
  762.  
  763. <Define Panel> "Build Guide intro"
  764. The AGSample Guide is built by Guide Maker. The source files are:
  765.    • AGSampleGuide.ag - Guide Script
  766.    • AGSamplePICT.rsrc - PICT resources for Guide
  767.    • AGSSearchPhrases.rsrc - STR# resources for search
  768.    • AGSampleASCoach1001 - AppleScript for Coach
  769.    • AGSampleASCoach2001 - AppleScript for Coach
  770. Include these 5 files in a single folder.
  771. <End Panel>
  772.  
  773. <Define Panel> "AGSampleGuide"
  774. AGSampleGuide.ag contains the Guide Script for this guide.
  775. <End Panel>
  776.  
  777. <Define Panel> "AGSamplePICT"
  778. AGSamplePICT.rsrc contains the PICTs needed for this guide.
  779. <End Panel>
  780.  
  781. <Define Panel> "AGSSearchPhrases"
  782. AGSSearchPhrases.rsrc is provided as an example of one way to store search phrases.
  783.  
  784. If you use AGOpenWithSearch in your application and you want to follow the model, you can modify AGSSearchPhrases.rsrc and include it in your build of the guide.
  785. <End Panel>
  786.  
  787. <Define Panel> "AGSampleASCoach"
  788. AGSampleASCoach1001 and AGSampleASCoach2001 contain AppleScripts for AppleScript Coach.
  789.  
  790. If you use AppleScript Coach, you can modify and include these scripts for use in your own guide.
  791. <End Panel>
  792.  
  793. <Define Panel> "Build Guide 1"
  794. <Format> "Tag"
  795. Do This
  796. <Format> "Body"
  797. To build AGSample Guide, startup Guide Maker.
  798. <End Panel>
  799.  
  800. <Define Panel> "Build Guide 2"
  801. <Format> "Tag"
  802. Do This
  803. <Format> "Body"
  804. Use the Build command in Guide Maker.
  805.  
  806. Select AGSampleGuide.ag as the source file and create a new guide file.
  807. <End Panel>
  808.  
  809. <Define Panel> "Build Guide 3"
  810. <Format> "Tag"
  811. Do This
  812. <Format> "Body"
  813. Click the Compile button.
  814.  
  815. The guide will be compiled. The other guide source files will be included automatically.
  816. <End Panel>
  817.  
  818. <Define Panel> "Build Guide compile error"
  819. When you build this guide, you will get several warnings about missing external modules.
  820.  
  821. Ignore the warnings.
  822.  
  823. Guide Maker expects external modules to be included in the guide file. Since we are using context check handlers in the application, we do not need to provide external modules.
  824. <End Panel>
  825.  
  826. <Define Panel> "Integrate sample intro"
  827. Integration consists of modifying and building your application with all or part of the Apple Guide sample code.
  828. <End Panel>
  829.  
  830. <Define Panel> "Integrate sample functions"
  831. <Format> "Tag"
  832. Do This
  833. <Format> "Body"
  834. Select which functions in AGSampleCode.c and AGSampleCode.h that you wish to include in your application.
  835. <End Panel>
  836.  
  837. <Define Panel> "AppleGuideGlueLib"
  838. <Format> "Tag"
  839. Do This
  840. <Format> "Body"
  841. Add AppleGuideGlueLib.xcoff if you are building a PPC applications.
  842. <End Panel>
  843.  
  844. <Define Panel> "AGFile"
  845. <Format> "Tag"
  846. Do This
  847. <Format> "Body"
  848. Add the 68K or PPC AGFile library if you are using any of the AGFile functions.
  849. <End Panel>
  850.  
  851. <Define Panel> "aete"
  852. Use the AppleScript Coach 'aete' resource if you want to make your AppleScript Coach objects publically accessible.
  853.  
  854. The 'aete' can be added using AGSampleASCoach.r or AGSampleASCoach.rsrc.
  855. <End Panel>
  856.  
  857. <Define Panel> "Add aete"
  858. <Format> "Tag"
  859. Do This
  860. <Format> "Body"
  861. Add the AppleScript Coach 'aete' resource if you want to make your AppleScript Coach objects publically accessible.
  862.  
  863. The 'aete' can be added using AGSampleASCoach.r or AGSampleASCoach.rsrc.
  864. <End Panel>
  865.  
  866. <Define Panel> "You are done"
  867. That's all.
  868.  
  869. Sample code, some libraries, a resource or two, and you are done.
  870. <End Panel>
  871.  
  872.